package edu.zqu.course.config;

import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import springfox.documentation.builders.RequestHandlerSelectors;
import springfox.documentation.spi.DocumentationType;
import springfox.documentation.spring.web.plugins.Docket;
import springfox.documentation.swagger2.annotations.EnableSwagger2;

/**
 * 配置swagger2
 */


@Configuration
@EnableSwagger2
public class SwaggerConfig {

    //为API配置分组：课程分组
    @Bean
    public Docket docketCourse() {
        return new Docket(DocumentationType.SWAGGER_2)
                //为分组起名字
                .groupName("课程模块")
                .select()
                //指定要扫描的包
                .apis(RequestHandlerSelectors.basePackage("edu.zqu.course.project.controller"))
//                .paths(PathSelectors.ant("/course/**"))
                .build();
    }
}
